import config from "@/config"
import http from "@/utils/request"

export default {
	dict_type: {
		lists: {
			url: `${config.API_URL}/adminapi/setting.dict.dict_type/lists`,
			name: "获取字典列表",
			get: async function(){
				return await http.get(this.url);
			}
		},
		all: {
			url: `${config.API_URL}/adminapi/setting.dict.dict_type/all`,
			name: "获取字典列表",
			get: async function(){
				return await http.get(this.url);
			}
		},
		add: {
			url: `${config.API_URL}/adminapi/setting.dict.dict_type/add`,
			name: "添加字典类型",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit: {
			url: `${config.API_URL}/adminapi/setting.dict.dict_type/edit`,
			name: "编辑字典类型",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		delete: {
			url: `${config.API_URL}/adminapi/setting.dict.dict_type/delete`,
			name: "删除字典类型",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		deleteAll: {
			url: `${config.API_URL}/adminapi/setting.dict.dict_type/delete_all`,
			name: "删除字典类型",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
	},
	dict_data: {
		lists: {
			url: `${config.API_URL}/adminapi/setting.dict.dict_data/lists`,
			name: "获取字典列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		all: {
			url: `${config.API_URL}/adminapi/setting.dict.dict_data/all`,
			name: "获取字典列表",
			get: async function(){
				return await http.get(this.url);
			}
		},
		add: {
			url: `${config.API_URL}/adminapi/setting.dict.dict_data/add`,
			name: "添加字典类型",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		edit: {
			url: `${config.API_URL}/adminapi/setting.dict.dict_data/edit`,
			name: "编辑字典类型",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		delete: {
			url: `${config.API_URL}/adminapi/setting.dict.dict_data/delete`,
			name: "删除字典类型",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		deleteAll: {
			url: `${config.API_URL}/adminapi/setting.dict.dict_data/delete_all`,
			name: "删除字典类型",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
	},
	code: {
		generateTable: {
			url: `${config.API_URL}/adminapi/tools.generator/generateTable`,
			name: "获取已选数据表列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		dataTable: {
			url: `${config.API_URL}/adminapi/tools.generator/dataTable`,
			name: "获取数据表列表",
			get: async function(params){
				return await http.get(this.url,params);
			}
		},
		selectTable: {
			url: `${config.API_URL}/adminapi/tools.generator/selectTable`,
			name: "选择要生成代码的数据表",
			post: async function(params){
				return await http.post(this.url,params);
			}
		},
		tableDetail: {
			url: `${config.API_URL}/adminapi/tools.generator/detail`,
			name: "已选择的数据表详情",
			get: async function(params){
				return await http.get(this.url,params);
			}
		},
		syncColumn: {
			url: `${config.API_URL}/adminapi/tools.generator/syncColumn`,
			name: "同步字段",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		generateEdit: {
			url: `${config.API_URL}/adminapi/tools.generator/edit`,
			name: "编辑已选表字段",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		generateDelete: {
			url: `${config.API_URL}/adminapi/tools.generator/delete`,
			name: "删除已选择的数据表",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		generatePreview: {
			url: `${config.API_URL}/adminapi/tools.generator/preview`,
			name: "预览代码",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		generateCode: {
			url: `${config.API_URL}/adminapi/tools.generator/generate`,
			name: "生成代码",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
		getModels: {
			url: `${config.API_URL}/adminapi/tools.generator/getModels`,
			name: "获取模型",
			post: async function(params){
				return await http.post(this.url, params);
			}
		},
	},
}
